//1.引入vue
import Vue from 'vue';
//2.新创建一个vue实例
let v = new Vue();

export default{



  data() {
    return {
        flag:0,
    }
  },
  


       //网页普通消息
        message(msg) {
            v.$message(msg);
          },
    
        //成功信息
        success(mag) {
         
            v.$message({
              message: mag,
              type: 'success'
            });
          },
     
          //警告信息
          warning(msg) {
            v.$message({
              message: msg,
              type: 'warning'
            });
          },
     
          //错误信息
          error(msg) {
            v.$message.error(msg);
          },


          confirm:function()
          {

            var that = this;

            v.$confirm('此操作将永久删除该信息, 是否继续?', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
    
              that.flag = 1 
            

            }).catch(() => {
            
              this.message('已取消删除!')
              that.flag = 0
            });

            return that.flag

          },
          
        
    

          datail(index){
            alert(index)
 
            if(index==1){

            }else if(index==2){

            }else if(index==3){

              v.$router.push('/ShoppingCard')
              
            }else if(index==4){

            }else if(index==5){

            }else{

            }
          }
    

    


}